import { ADD_PERSON } from '../constant'

// 初始化人员列表
const initState = []

export default function personReducer(prevState = initState, action) {
  const { type, data } = action

  switch (type) {
    case ADD_PERSON:
      return [data, ...prevState]
    default:
      return prevState
  }
}
